package com.itheima.ip;

import java.net.InetAddress;
import java.net.UnknownHostException;

/*
IP类
 */
public class Demo01 {

    public static void main(String[] args) throws UnknownHostException {
        InetAddress ipaddress = InetAddress.getByName("192.168.23.1");
        String hostName = ipaddress.getHostName();
        String ip = ipaddress.getHostAddress();
        System.out.println(hostName);
        System.out.println(ip);


    }
}
